from selenium.webdriver.common.by import By

class UserSLBLocator:

    # billing_method  选择 Subscription
    billing_method = (By.XPATH,'//*[@value="Subscription"]/..')
    # instance name
    instance_name = (By.ID, 'creForm_instanceName')
    # network type——intranet
    intranet_button = (By.XPATH, '//span[text() = "Intranet"]')
    # VPC刷新按钮
    vpc_refresh = (By.XPATH, '(//div[contains(@class,"icon-wrap___Axgjq")])[1]')
    # VPC下拉第一个选项
    vpc_first_select = (By.XPATH, '(//div[contains(@class,"antd4-select-item antd4-select-item-option antd4-select-item-option-active")])[1]')
    # vSwitch选择框
    #vswitch_select = (By.XPATH, '(//div[contains(@class,"antd4-select-selector")])[4]')
    vswitch_select = (By.XPATH, '//*[@id="creForm_vSwitchId"]')

    # vSwitch下拉第一个选项
    vswitch_first_select = (By.XPATH, '(//div[contains(@class,"antd4-select-item antd4-select-item-option antd4-select-item-option-active")])[2]')

    #pag按钮
    pag_buttoon= (By.XPATH, '//span[text() = "Pay-As-You-Go"]')

    #release按钮
    release_button = (By.XPATH, '//span[text() = "Release"]')
    # actions按钮
    actions_button = (By.XPATH, '(//div[contains(@class,"antd4-dropdown-trigger table-operation-omit")])[1]')
    # release界面释放按钮
    real_release_button = (By.CSS_SELECTOR, '[class="antd4-btn antd4-btn-primary antd4-btn-lg releaseBtn___27j7c"]')
    # 确认删除按钮
    confirm_release_button = (By.XPATH, '//span[text() = "Yes, release"]')
    # 释放成功提示语
    release_success = (By.XPATH, '(//span[contains(@class,"resultTitle___2AfnO")])[1]')

    #释放后查看slb状态
    slb_status= (By.XPATH, '(//div[contains(@class,"antd4-space-item")])[13]')

    #modify按钮
    modify_button = (By.XPATH, '//span[text() = "Modify"]')
    #instance type第二个选项
    instance_type_button= (By.XPATH, '(//td[contains(@class,"antd4-table-cell antd4-table-selection-column")])[3]')
    #instance type名字
    instance_type = (By.XPATH, '(//div[contains(@class,"cre-table-nowrap")])[6]')
    # orders菜单
    orders_menu = (By.CSS_SELECTOR, '[path="/work_bench/userCenter/order/order"]')
    # 搜索类型选择框
    type_select = (By.XPATH, '(//div[contains(@class,"antd4-select-selector")])[1]')
    # instance id 下拉框
    instance_id_select = (By.XPATH, '(//div[contains(@class,"antd4-select-item-option-content")])[3]')
    #instance输入框
    instance_input = (By.ID, 'instanceId')
    #查询按钮
    search_button = (By.CSS_SELECTOR,'[class="antd4-btn antd4-btn-default antd4-btn-icon-only antd4-input-search-button"]')
    #view details按钮
    view_details_button = (By.XPATH, '(//div[contains(@class,"table-operation-btnLine-content")])[1]')
    #修改后的instance type
    new_instance_type = (By.XPATH, '(//span[contains(@class,"changeValue___3yAjY")])[1]')

    #续费界面新的过期时间
    new_expiration_date = (By.XPATH, '(//span[contains(@class,"newExpirationDate___3OiQT")])[1]')
    #列表展示续费后的过期时间
    new_expired_time = (By.XPATH, '(//div[contains(@class,"expireTimeContainer___3F-nr))[1]')
    #renew按钮
    renew_button = (By.XPATH, '//span[text() = "Renew"]')

    #切换组织按钮
    modify_organization_button = (By.XPATH, '//span[text() = "Change Organization"]')
    # change organization选择框
    change_organization_select = (By.XPATH, '(//div[contains(@class,"antd4-select-selector")])[4]')
    # chang organization下拉选择
    change_organization_first_select = (By.XPATH,'(//span[contains(@class,"antd4-select-tree-node-content-wrapper antd4-select-tree-node-content-wrapper-open")])[1]')
    change_organization_second_select = (By.XPATH,'(//span[contains(@class,"antd4-select-tree-node-content-wrapper antd4-select-tree-node-content-wrapper-normal")])[1]')
    # submit按钮
    submit_button = (By.XPATH, '//span[text() = "Submit"]')
    #列表organization字段
    organization = (By.XPATH, '(//div[contains(@class,"cre-table-nowrap")])[4]')

    #change billing method按钮1
    change_billing_method_button = (By.XPATH, '(//span[contains(@class,"anticon anticon-edit editIcon___3kg65")])[1]')
    # check order 按钮
    check_order_button = (By.XPATH, '//span[text() = "Check Order"]')
    #orders记录类型
    orders_type = (By.XPATH, '(//div[contains(@class,"cre-table-nowrap")])[2]')
    #orders 界面billing method
    orders_billing_method = (By.XPATH, '(//div[contains(@class,"cre-table-nowrap")])[5]')

    #buy now按钮
    buy_now_button= (By.XPATH, '//span[text() = "Buy Now"]')

    # instance id跳转
    instance_id = (By.XPATH, '(//div[contains(@class,"cre-table-nowrap")])[1]')
    #界面overview字段
    overview = (By.XPATH, '(//div[contains(@class,"teamix-nav-sidebar-header-name")])[1]')

    #状态reset按钮
    status_filter_reset_button = (By.XPATH, '(//button[contains(@class,"antd4-btn antd4-btn-link antd4-btn-sm")])[1]')
    status_filter_reset_button2 = (By.XPATH, '(//button[contains(@class,"antd4-btn antd4-btn-link antd4-btn-sm")])[2]')
    status_filter_reset_button3 = (By.XPATH, '(//button[contains(@class,"antd4-btn antd4-btn-link antd4-btn-sm")])[3]')
    status_filter_reset_button4 = (By.XPATH, '(//button[contains(@class,"antd4-btn antd4-btn-link antd4-btn-sm")])[4]')

    # OK按钮
    status_filter_ok_button = (By.XPATH, '(//button[contains(@class,"antd4-btn antd4-btn-primary antd4-btn-sm")])[1]')
    status_filter_ok_button2 = (By.XPATH, '(//button[contains(@class,"antd4-btn antd4-btn-primary antd4-btn-sm")])[2]')
    status_filter_ok_button3 = (By.XPATH, '(//button[contains(@class,"antd4-btn antd4-btn-primary antd4-btn-sm")])[3]')
    status_filter_ok_button4= (By.XPATH, '(//button[contains(@class,"antd4-btn antd4-btn-primary antd4-btn-sm")])[4]')
    # orders界面product筛选项
    product_filter_button = (By.XPATH, "(//span[contains(@class,'antd4-dropdown-trigger antd4-table-filter-trigger')])[1]")
    # orders界面order type筛选项
    order_type_filter_button = (By.XPATH, "(//span[contains(@class,'antd4-dropdown-trigger antd4-table-filter-trigger')])[2]")
    # orders界面order status筛选项
    order_status_filter_button = (By.XPATH, "(//span[contains(@class,'antd4-dropdown-trigger antd4-table-filter-trigger')])[3]")
    # orders界面billing method筛选项
    billing_method_filter_button = (By.XPATH, "(//span[contains(@class,'antd4-dropdown-trigger antd4-table-filter-trigger')])[4]")


    #deployment_set2_select
    #vpc_select=(By.XPATH, '(//div[contains(@class,"antd4-select-selector")])[3]')
    vpc_select=(By.XPATH, '//*[@id="creForm_vpcId"]')


    #deployment_set2_option
    vpc_option=(By.XPATH,"//div[@id='rc_select_3_list']/../div[2]//div[@class='antd4-select-item-option-content']")

    #menu_list
    menu_list=(By.CSS_SELECTOR,'[class="product-menu-tigger"]')


    #slb_instance_management
    slb_instance_management=(By.CSS_SELECTOR,'[displaytext="Instance Management"]')

    #console_instance_name_input
    console_instance_name_input=(By.CSS_SELECTOR,'[placeholder="Search by name, ID or IP address"]')

    #console_search_button
    console_search_button=(By.CSS_SELECTOR,'[class="next-search next-search-normal next-normal next-medium visible next-search-no-custom-search-text"]>:nth-child(1)>:nth-child(2)')

    #slb_instance_id_ele
    slb_instance_id_ele=(By.CSS_SELECTOR,'[class="copyModule"]>div>a>span')

    # slb_instance_id
    slb_instance_id=(By.CSS_SELECTOR,'[class="teamix-typography copyDiv"]')

    #slb_instance_edition
    slb_instance_edition=(By.CSS_SELECTOR,'[class="antd4-radio"]')
